<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>My JSP 'index.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<c:if test="${not empty msg}">
		<script type="text/javascript">
			alert("${msg}");
		</script>
	</c:if>
  </head>
  
  <body>
    <h1>修改用户</h1>
    <form action="user_modify" method="post">
    	<input type="hidden" name="id" value="${user.id}"/>
    	用户名：<input type="text" name="name" value="${user.name}"/><br/>
    	年&nbsp;&nbsp;&nbsp;&nbsp;龄：<input type="text" name="age" value="${user.age}"/><br/>
    	分&nbsp;&nbsp;&nbsp;&nbsp;组：
    	<select name="gid">
    		<c:forEach items="${groups}" var="group">
    			<option value="${group.id}" ${user.group.id == group.id ? 'selected=\"selected\"' : ''}>${group.name}</option>
    		</c:forEach>
    	</select>
    	<br/>
    	<input type="submit" value="提交"/>
    </form>
  </body>
</html>
